﻿using HiSport.Core.Entities;
using HiSport.Core.Enum;
using Newtonsoft.Json;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace HiSport.Core.Entity
{
    [SugarTable("Sys_User")]
    public class SysUser : BaseFullEntity
    {
        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnDescription = "账号", Length = 32)]
        [Required, MaxLength(32)]
        public virtual string? Account { get; set; }

        /// <summary>
        /// 账号
        /// </summary>
        [SugarColumn(ColumnDescription = "名称", Length = 32)]
        [Required, MaxLength(32)]
        public virtual string? Name { get; set; }


        /// <summary>
        /// 密码
        /// </summary>
        [SugarColumn(ColumnDescription = "密码", Length = 512)]
        [MaxLength(512)]
        public virtual string Password { get; set; }


        /// <summary>
        /// 头像
        /// </summary>
        [SugarColumn(ColumnDescription = "头像", Length = 512)]
        [MaxLength(512)]
        public string? Avatar { get; set; }

        /// <summary>
        /// 手机号码
        /// </summary>
        [SugarColumn(ColumnDescription = "手机号码", Length = 16)]
        [MaxLength(16)]
        public string? Phone { get; set; }

     
        /// <summary>
        /// 邮箱
        /// </summary>
        [SugarColumn(ColumnDescription = "邮箱", Length = 64)]
        [MaxLength(64)]
        public string? Email { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        [SugarColumn(ColumnDescription = "地址", Length = 256)]
        [MaxLength(256)]
        public string? Address { get; set; }

     
        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnDescription = "状态 0:禁用   1:启用")]
        public StatusEnum Status { get; set; } = StatusEnum.Enable;

        /// <summary>
        /// 备注
        /// </summary>
        [SugarColumn(ColumnDescription = "备注", Length = 256)]
        [MaxLength(256)]
        public string? Remark { get; set; }

        /// <summary>
        /// 账号类型
        /// </summary>
        [SugarColumn(ColumnDescription = "账号类型")]
        public AccountTypeEnum AccountType { get; set; } = AccountTypeEnum.NormalUser;

      
        
        /// <summary>
        /// 最新登录Ip
        /// </summary>
        [SugarColumn(ColumnDescription = "最新登录Ip", Length = 256)]
        [MaxLength(256)]
        public string? LastLoginIp { get; set; }

        /// <summary>
        /// 最新登录地点
        /// </summary>
        [SugarColumn(ColumnDescription = "最新登录地点", Length = 128)]
        [MaxLength(128)]
        public string? LastLoginAddress { get; set; }

        /// <summary>
        /// 最新登录时间
        /// </summary>
        [SugarColumn(ColumnDescription = "最新登录时间")]
        public DateTime? LastLoginTime { get; set; }

        /// <summary>
        /// 最新登录设备
        /// </summary>
        [SugarColumn(ColumnDescription = "最新登录设备", Length = 128)]
        [MaxLength(128)]
        public string? LastLoginDevice { get; set; }



    }
}
